@extends("la.layouts.app")

@section("contentheader_title")
    <a href="{{ url(config('laraadmin.adminRoute') . '/wechat-upload') }}">微信资源管理</a> :
@endsection
@section("contentheader_description", '推广域名管理')
@section("section", "推广域名管理")
@section("section_url", url(config('laraadmin.adminRoute') . '/domain'))
@section("sub_section", "Edit")

@section("htmlheader_title", "编辑推广域名")

@section("main-content")

    @if (count($errors) > 0)
        <div class="alert alert-danger">
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    @endif

    <div class="box">
        <div class="box-header">

        </div>
        <div class="box-body">
            <div class="row">
                <div class="col-md-8 col-md-offset-2">
                    <form method="POST" action="/admin/domain/{{ $domain ? $domain->id : 0}}" accept-charset="UTF-8" id="organization-edit-form" novalidate="novalidate">
                        <input name="_method" type="hidden" value="PUT">
                        <input name="id" type="hidden" value="{{ $domain ? $domain->id : 0}}" />
                        {!! csrf_field() !!}
                        <div class="form-group">
                            <label for="name">域名 :</label>
                            <input class="form-control" name="domain" value="{{ $domain ? $domain->domain : '' }}"/>
                        </div>
                        <div class="form-group">
                            <label for="name">状态 :</label>
                            <select name="status" class="form-control">
                                <option value="0" {{ $domain ? (0 == $domain->status ? 'selected' : '') : '' }}>禁用</option>
                                <option value="1" {{ $domain ? (1 == $domain->status ? 'selected' : '') : '' }}>启用</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <input class="btn btn-success" type="submit" value="修改">
                            <button type="button" class="btn btn-default pull-right">
                                <a href="/admin/domain">返回</a>
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

@endsection

@push('scripts')
    <script>
        $(function () {
            $("#organization-edit-form").validate({

            });
        });
    </script>
@endpush
